package com.cirnoworks.uhs;

public final class AddressKey implements Cloneable {
	private long address;
	private int port;

	public long getAddress() {
		return address;
	}

	public void setAddress(long address) {
		this.address = address;
	}

	public int getPort() {
		return port;
	}

	public void setPort(int port) {
		this.port = port;
	}

	public int hashCode() {
		return ((int) (address ^ (address >>> 32))) ^ (port << 16);
	}

	public boolean equals(Object other) {
		if (other == null) {
			return false;
		}
		if (other instanceof AddressKey) {
			AddressKey o = (AddressKey) other;
			return o.address == address && o.port == port;
		}
		return false;
	}

	public AddressKey clone() {
		try {
			return (AddressKey) super.clone();
		} catch (CloneNotSupportedException e) {
			throw new RuntimeException(e);
		}
	}
}
